import {http} from '@/libs/httpRequest';

// 表格数据
export function getList (params) {
    return http({
        url: '/admin/file/list',
        method: 'get',
        params: params
    })
}

// 回收站列表
export function getRecycleList (params) {
    return http({
        url: '/admin/file/getRecycleList',
        method: 'get',
        params: params
    })
}
// 清空回收站
export function clearRecycle (data) {
    return http({
        url: '/admin/file/clearRecycle',
        method: 'delete',
        data: data
    })
}

// 保存文件
export function save (data) {
    return http({
        url: '/admin/file/save',
        method: 'post',
        data: data
    })
}

// 修改文件
export function update (data) {
    return http({
        url: '/admin/file/update',
        method: 'post',
        data: data
    })
}

//删除文件
export function remove(data){
    return http({
        url:'/admin/file/delete',
        method:'delete',
        data:data
    })
}
//新建文件夹
export function addFolder(data){
    return http({
        url:'/admin/file/addFolder',
        method:'post',
       data:data
    })
}
//重命名
export function rename(data){
    return http({
        url:'/admin/file/rename',
        method:'post',
       data:data
    })
}
//加入回收站
export function addToRecycle(data){
    return http({
        url:'/admin/file/addToRecycle',
        method:'post',
       data:data
    })
}
//移动文件
export function moveFile(data){
    return http({
        url:'/admin/file/moveFile',
        method:'post',
       data:data
    })
}
//获取文件夹目录
export function selectFolders(params){
    return http({
        url:'/admin/file/selectFolders',
        method:'get',
      params:params
    })
}


// 还原
export function restoreFile (data) {
  return http({
    url: '/admin/file/restoreFile',
    method: 'post',
    data: data
  })
}
